<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
	<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
</head>

<body>
	<pre>
		$(window).click(() => {
			console.log('clicked1');
			Promise.resolve().then(() => console.log('clicked promise1'));
			setTimeout(() => console.log('clicked timeout1'), 0);
		});
		
		$(window).click(() => {
			setTimeout(() => {
				console.log('clicked2');
				Promise.resolve().then(() => console.log('clicked promise2'));
				setTimeout(() => console.log('clicked timeout2'), 0);
			}, 0);
		});
		
		$(window).click(() => {
			Promise.resolve().then(() => {
				console.log('clicked3');
				Promise.resolve().then(() => console.log('clicked promise3'));
				setTimeout(() => console.log('clicked timeout3'), 0);
			});
		});
		
	</pre>
	<script>
		$(window).click(() => {
			console.log('clicked1');
			Promise.resolve().then(() => console.log('clicked promise1'));
			setTimeout(() => console.log('clicked timeout1'), 0);
		});

		$(window).click(() => {
			setTimeout(() => {
				console.log('clicked2');
				Promise.resolve().then(() => console.log('clicked promise2'));
				setTimeout(() => console.log('clicked timeout2'), 0);
			}, 0);
		});

		$(window).click(() => {
			Promise.resolve().then(() => {
				console.log('clicked3');
				Promise.resolve().then(() => console.log('clicked promise3'));
				setTimeout(() => console.log('clicked timeout3'), 0);
			});
		});

	</script>
</body>

</html>